package nav

/*
#include<stdint.h>
#include<stdbool.h>
extern void nav_dtNode_Delete(void * c_this);
extern void nav_dtNode_DeleteArray(void * c_this);
extern void* nav_NewdtNode();
extern unsigned int nav_dtNode_GetBitFieldOfFlags(void * c_this);
extern unsigned int nav_dtNode_GetBitFieldOfPidx(void * c_this);
extern unsigned int nav_dtNode_GetBitFieldOfState(void * c_this);
extern void * nav_dtNode_GetPtrToCost(void * c_this);
extern void * nav_dtNode_GetPtrToId(void * c_this);
extern void * nav_dtNode_GetPtrToPos(void * c_this);
extern void * nav_dtNode_GetPtrToTotal(void * c_this);
extern void * nav_dtNode_IndexArray(void * c_this,long n);
extern void nav_dtNode_SetFieldOfFlags(void * c_this,unsigned int value);
extern void nav_dtNode_SetFieldOfPidx(void * c_this,unsigned int value);
extern void nav_dtNode_SetFieldOfState(void * c_this,unsigned int value);
extern void nav_dtNodePool_clear(void * c_this);
extern void nav_dtNodePool_Delete(void * c_this);
extern void nav_dtNodePool_DeleteArray(void * c_this);
extern void* nav_NewdtNodePool(int maxNodes,int hashSize);
extern void * nav_dtNodePool_findNode(void * c_this,unsigned int id,unsigned char state);
extern unsigned int nav_dtNodePool_findNodes(void * c_this,unsigned int id,void * nodes,int maxNodes);
extern unsigned short nav_dtNodePool_getFirst(void * c_this,int bucket);
extern int nav_dtNodePool_getHashSize(void * c_this);
extern int nav_dtNodePool_getMaxNodes(void * c_this);
extern int nav_dtNodePool_getMemUsed(void * c_this);
extern unsigned short nav_dtNodePool_getNext(void * c_this,int i);
extern void * nav_dtNodePool_getNode(void * c_this,unsigned int id,unsigned char state);
extern void * nav_dtNodePool_getNodeAtIdx(void * c_this,unsigned int idx);
extern void * nav_dtNodePool_getNodeAtIdx11(void * c_this,unsigned int idx);
extern int nav_dtNodePool_getNodeCount(void * c_this);
extern unsigned int nav_dtNodePool_getNodeIdx(void * c_this,void * node);
extern void * nav_dtNodePool_IndexArray(void * c_this,long n);
extern void nav_dtNodeQueue_clear(void * c_this);
extern void nav_dtNodeQueue_Delete(void * c_this);
extern void nav_dtNodeQueue_DeleteArray(void * c_this);
extern void* nav_NewdtNodeQueue(int n);
extern bool nav_dtNodeQueue_empty(void * c_this);
extern int nav_dtNodeQueue_getCapacity(void * c_this);
extern int nav_dtNodeQueue_getMemUsed(void * c_this);
extern void * nav_dtNodeQueue_IndexArray(void * c_this,long n);
extern void nav_dtNodeQueue_modify(void * c_this,void * node);
extern void * nav_dtNodeQueue_pop(void * c_this);
extern void nav_dtNodeQueue_push(void * c_this,void * node);
extern void * nav_dtNodeQueue_top(void * c_this);
extern void * nav_NewDtNodePtrArray(long n);

*/
import "C"
import "unsafe"
import "gitee.com/hasika/cgo"

var _ unsafe.Pointer
var _ cgo.NotUsed

type DtNodePtr uintptr

/*
public void Delete()
*/
func (p DtNodePtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNode_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p DtNodePtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNode_DeleteArray(wrap_this)
}

/*
public dtNode()
*/
func NewDtNode() cgo.GoManagedPtr[DtNodePtr] {
	wrap_out := C.nav_NewdtNode()
	go_out := cgo.MakePtr[cgo.GoManagedPtr[DtNodePtr]](uintptr(wrap_out))
	return go_out
}

/*
Node flags. A combination of dtNodeFlags.

public unsigned int GetBitFieldOfFlags()
*/
func (p DtNodePtr) GetBitFieldOfFlags() uint32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetBitFieldOfFlags(wrap_this)
	go_out := uint32(wrap_out)
	return go_out
}

/*
Index to parent node.

public unsigned int GetBitFieldOfPidx()
*/
func (p DtNodePtr) GetBitFieldOfPidx() uint32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetBitFieldOfPidx(wrap_this)
	go_out := uint32(wrap_out)
	return go_out
}

/*
extra state information. A polyRef can have multiple nodes with different extra info. see DT_MAX_STATES_PER_NODE

public unsigned int GetBitFieldOfState()
*/
func (p DtNodePtr) GetBitFieldOfState() uint32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetBitFieldOfState(wrap_this)
	go_out := uint32(wrap_out)
	return go_out
}

/*
Cost from previous node to current node.

public float * GetPtrToCost()
*/
func (p DtNodePtr) GetPtrToCost() *float32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetPtrToCost(wrap_this)
	go_out := (*float32)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
Polygon ref the node corresponds to.

public dtPolyRef * GetPtrToId()
*/
func (p DtNodePtr) GetPtrToId() *uint32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetPtrToId(wrap_this)
	go_out := (*uint32)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
Position of the node.

public float(*)[3] GetPtrToPos()
*/
func (p DtNodePtr) GetPtrToPos() *[3]float32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetPtrToPos(wrap_this)
	go_out := (*[3]float32)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
Cost up to the node.

public float * GetPtrToTotal()
*/
func (p DtNodePtr) GetPtrToTotal() *float32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_GetPtrToTotal(wrap_this)
	go_out := (*float32)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
dtNode * IndexArray(long n)
*/
func (p DtNodePtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNode_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
Node flags. A combination of dtNodeFlags.

public void SetFieldOfFlags(unsigned int value)
*/
func (p DtNodePtr) SetFieldOfFlags(value uint32) {
	var wrap_this unsafe.Pointer
	var wrap_arg_value C.uint
	wrap_this = unsafe.Pointer(p)
	wrap_arg_value = (C.uint)(value)
	C.nav_dtNode_SetFieldOfFlags(wrap_this, wrap_arg_value)
}

/*
Index to parent node.

public void SetFieldOfPidx(unsigned int value)
*/
func (p DtNodePtr) SetFieldOfPidx(value uint32) {
	var wrap_this unsafe.Pointer
	var wrap_arg_value C.uint
	wrap_this = unsafe.Pointer(p)
	wrap_arg_value = (C.uint)(value)
	C.nav_dtNode_SetFieldOfPidx(wrap_this, wrap_arg_value)
}

/*
extra state information. A polyRef can have multiple nodes with different extra info. see DT_MAX_STATES_PER_NODE

public void SetFieldOfState(unsigned int value)
*/
func (p DtNodePtr) SetFieldOfState(value uint32) {
	var wrap_this unsafe.Pointer
	var wrap_arg_value C.uint
	wrap_this = unsafe.Pointer(p)
	wrap_arg_value = (C.uint)(value)
	C.nav_dtNode_SetFieldOfState(wrap_this, wrap_arg_value)
}

type DtNodePoolPtr uintptr

/*
public void clear()
*/
func (p DtNodePoolPtr) Clear() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNodePool_clear(wrap_this)
}

/*
public void Delete()
*/
func (p DtNodePoolPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNodePool_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p DtNodePoolPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNodePool_DeleteArray(wrap_this)
}

/*
public dtNodePool(int maxNodes, int hashSize)
*/
func NewDtNodePool(maxNodes int32, hashSize int32) cgo.GoManagedPtr[DtNodePoolPtr] {
	var wrap_arg_maxNodes C.int
	var wrap_arg_hashSize C.int
	wrap_arg_maxNodes = (C.int)(maxNodes)
	wrap_arg_hashSize = (C.int)(hashSize)
	wrap_out := C.nav_NewdtNodePool(wrap_arg_maxNodes, wrap_arg_hashSize)
	go_out := cgo.MakePtr[cgo.GoManagedPtr[DtNodePoolPtr]](uintptr(wrap_out))
	return go_out
}

/*
public dtNode * findNode(dtPolyRef id, unsigned char state)
*/
func (p DtNodePoolPtr) FindNode(id uint32, state uint8) DtNodePtr {
	var wrap_this unsafe.Pointer
	var wrap_arg_id C.uint
	var wrap_arg_state C.uchar
	wrap_this = unsafe.Pointer(p)
	wrap_arg_id = (C.uint)(id)
	wrap_arg_state = (C.uchar)(state)
	wrap_out := C.nav_dtNodePool_findNode(wrap_this, wrap_arg_id, wrap_arg_state)
	go_out := cgo.MakePtr[DtNodePtr](uintptr(wrap_out))
	return go_out
}

/*
public unsigned int findNodes(dtPolyRef id, dtNode * * nodes, int const maxNodes)
*/
func (p DtNodePoolPtr) FindNodes(id uint32, nodes *DtNodePtr, maxNodes int32) uint32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_id C.uint
	var wrap_arg_nodes unsafe.Pointer
	var wrap_arg_maxNodes C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_id = (C.uint)(id)
	wrap_arg_nodes = (unsafe.Pointer)(nodes)
	wrap_arg_maxNodes = (C.int)(maxNodes)
	wrap_out := C.nav_dtNodePool_findNodes(wrap_this, wrap_arg_id, wrap_arg_nodes, wrap_arg_maxNodes)
	go_out := uint32(wrap_out)
	return go_out
}

/*
public dtNodeIndex getFirst(int bucket) const
*/
func (p DtNodePoolPtr) GetFirst(bucket int32) uint16 {
	var wrap_this unsafe.Pointer
	var wrap_arg_bucket C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_bucket = (C.int)(bucket)
	wrap_out := C.nav_dtNodePool_getFirst(wrap_this, wrap_arg_bucket)
	go_out := uint16(wrap_out)
	return go_out
}

/*
public int getHashSize() const
*/
func (p DtNodePoolPtr) GetHashSize() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodePool_getHashSize(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
public int getMaxNodes() const
*/
func (p DtNodePoolPtr) GetMaxNodes() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodePool_getMaxNodes(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
public int getMemUsed() const
*/
func (p DtNodePoolPtr) GetMemUsed() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodePool_getMemUsed(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
public dtNodeIndex getNext(int i) const
*/
func (p DtNodePoolPtr) GetNext(i int32) uint16 {
	var wrap_this unsafe.Pointer
	var wrap_arg_i C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_i = (C.int)(i)
	wrap_out := C.nav_dtNodePool_getNext(wrap_this, wrap_arg_i)
	go_out := uint16(wrap_out)
	return go_out
}

/*
Get a dtNode by ref and extra state information. If there is none then - allocate
There can be more than one node for the same polyRef but with different extra state information

public dtNode * getNode(dtPolyRef id, unsigned char state=0)
*/
func (p DtNodePoolPtr) GetNode(id uint32, state uint8) DtNodePtr {
	var wrap_this unsafe.Pointer
	var wrap_arg_id C.uint
	var wrap_arg_state C.uchar
	wrap_this = unsafe.Pointer(p)
	wrap_arg_id = (C.uint)(id)
	wrap_arg_state = (C.uchar)(state)
	wrap_out := C.nav_dtNodePool_getNode(wrap_this, wrap_arg_id, wrap_arg_state)
	go_out := cgo.MakePtr[DtNodePtr](uintptr(wrap_out))
	return go_out
}

/*
public dtNode * getNodeAtIdx(unsigned int idx)
*/
func (p DtNodePoolPtr) GetNodeAtIdx(idx uint32) DtNodePtr {
	var wrap_this unsafe.Pointer
	var wrap_arg_idx C.uint
	wrap_this = unsafe.Pointer(p)
	wrap_arg_idx = (C.uint)(idx)
	wrap_out := C.nav_dtNodePool_getNodeAtIdx(wrap_this, wrap_arg_idx)
	go_out := cgo.MakePtr[DtNodePtr](uintptr(wrap_out))
	return go_out
}

/*
public dtNode const * getNodeAtIdx(unsigned int idx) const
*/
func (p DtNodePoolPtr) GetNodeAtIdx11(idx uint32) DtNodePtr {
	var wrap_this unsafe.Pointer
	var wrap_arg_idx C.uint
	wrap_this = unsafe.Pointer(p)
	wrap_arg_idx = (C.uint)(idx)
	wrap_out := C.nav_dtNodePool_getNodeAtIdx11(wrap_this, wrap_arg_idx)
	go_out := cgo.MakePtr[DtNodePtr](uintptr(wrap_out))
	return go_out
}

/*
public int getNodeCount() const
*/
func (p DtNodePoolPtr) GetNodeCount() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodePool_getNodeCount(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
public unsigned int getNodeIdx(dtNode const * node) const
*/
func (p DtNodePoolPtr) GetNodeIdx(node DtNodePtr) uint32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_node unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_node = (unsafe.Pointer)(node)
	wrap_out := C.nav_dtNodePool_getNodeIdx(wrap_this, wrap_arg_node)
	go_out := uint32(wrap_out)
	return go_out
}

/*
dtNodePool * IndexArray(long n)
*/
func (p DtNodePoolPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodePool_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

type DtNodeQueuePtr uintptr

/*
public void clear()
*/
func (p DtNodeQueuePtr) Clear() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNodeQueue_clear(wrap_this)
}

/*
public void Delete()
*/
func (p DtNodeQueuePtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNodeQueue_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p DtNodeQueuePtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtNodeQueue_DeleteArray(wrap_this)
}

/*
public dtNodeQueue(int n)
*/
func NewDtNodeQueue(n int32) cgo.GoManagedPtr[DtNodeQueuePtr] {
	var wrap_arg_n C.int
	wrap_arg_n = (C.int)(n)
	wrap_out := C.nav_NewdtNodeQueue(wrap_arg_n)
	go_out := cgo.MakePtr[cgo.GoManagedPtr[DtNodeQueuePtr]](uintptr(wrap_out))
	return go_out
}

/*
public bool empty() const
*/
func (p DtNodeQueuePtr) Empty() bool {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodeQueue_empty(wrap_this)
	go_out := bool(wrap_out)
	return go_out
}

/*
public int getCapacity() const
*/
func (p DtNodeQueuePtr) GetCapacity() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodeQueue_getCapacity(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
public int getMemUsed() const
*/
func (p DtNodeQueuePtr) GetMemUsed() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodeQueue_getMemUsed(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
dtNodeQueue * IndexArray(long n)
*/
func (p DtNodeQueuePtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodeQueue_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public void modify(dtNode * node)
*/
func (p DtNodeQueuePtr) Modify(node DtNodePtr) {
	var wrap_this unsafe.Pointer
	var wrap_arg_node unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_node = (unsafe.Pointer)(node)
	C.nav_dtNodeQueue_modify(wrap_this, wrap_arg_node)
}

/*
public dtNode * pop()
*/
func (p DtNodeQueuePtr) Pop() DtNodePtr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodeQueue_pop(wrap_this)
	go_out := cgo.MakePtr[DtNodePtr](uintptr(wrap_out))
	return go_out
}

/*
public void push(dtNode * node)
*/
func (p DtNodeQueuePtr) Push(node DtNodePtr) {
	var wrap_this unsafe.Pointer
	var wrap_arg_node unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_node = (unsafe.Pointer)(node)
	C.nav_dtNodeQueue_push(wrap_this, wrap_arg_node)
}

/*
public dtNode * top()
*/
func (p DtNodeQueuePtr) Top() DtNodePtr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtNodeQueue_top(wrap_this)
	go_out := cgo.MakePtr[DtNodePtr](uintptr(wrap_out))
	return go_out
}

/*
dtNode * NewDtNodePtrArray(long n)
*/
func NewDtNodePtrArray(n int) cgo.GoManagedPtr[cgo.Array[DtNodePtr]] {
	wrap_out := C.nav_NewDtNodePtrArray(C.long(n))
	go_out := cgo.MakePtr[cgo.GoManagedPtr[cgo.Array[DtNodePtr]]](uintptr(wrap_out))
	return go_out
}

type EnumDtNodeFlags uint32

const (
	EnumDtNodeFlags_DT_NODE_OPEN   EnumDtNodeFlags = 1
	EnumDtNodeFlags_DT_NODE_CLOSED EnumDtNodeFlags = 2
	/*
	   parent of the node is not adjacent. Found using raycast.
	*/
	EnumDtNodeFlags_DT_NODE_PARENT_DETACHED EnumDtNodeFlags = 4
)
